//
// Created by gogoqiu on 2021/9/23.
//

#ifndef WXTEST_MYAPP_H
#define WXTEST_MYAPP_H
#include <wx/wx.h>
#include "../data/PreferenceStorage.h"
#include "PreferenceCore.h"
//#include "PreferencesFrame.h"

//#define APP_TAG "TEST"

class PreferencesFrame;

/*
 * setup the MyTagApp
 * extend MyTagApp
 * extend PreferenceCore
 */
class MyTagApp : public wxApp
{
protected:
    //SqlitePreferenceStorage* mPrefStorage;
    //
    PreferenceCore *mPreferenceCore;
    static MyTagApp* myApp;
    wxString tag;
    //
    PreferencesFrame* mPreferencesFrame;
public:
    bool OnInit() override;
    //@Ignore
    static MyTagApp * getInstance(){
        return myApp;
    }
    /*
    void setAppTag( const wxString& _tag ){
        this->tag = _tag;
    }*/

    wxString getAppTag(){
        return this->tag;
    }

    /**
     *
     * @return
     */
    PreferenceCore *getPreferenceCore(){
        return mPreferenceCore;
    }

    void showPreferencesFrame( wxWindow *parent );

    //some class extends PreferenceCore
    void setPreferenceCore( PreferenceCore *preferenceCore ){
        mPreferenceCore = preferenceCore;
    }
};

#endif //WXTEST_MYAPP_H
